#include <iostream>
using namespace std;
const int N = 1e7 + 10;
int a[N];
int main()
{
	int n, m;

	cin >> n >> m;
	
	for (int i = 1; i <= n; i++)
	{
		cin >> a[i];
	}
	int sum = 0;
	int l = 0, r = 0;
	int len = 0x3f3f3f3f;
	int ll = 0, rr = 0;
	while (r <= n)
	{
		sum += a[r];
		while (sum >= m)
		{
			if (r - l + 1 < len)
			{
				ll = l;
				rr = r;
				len = r - l + 1;
			}
			sum -= a[l];
			l++;
		}
		r++;
	}
	cout << ll << " " << rr << endl;
	return 0;
}
